package com.yueqian.exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Test2 {
    public static void main(String[] args) {
        System.out.println("main start ...");
        method1();
        System.out.println("main end ...");
    }

    public static void method1() {
        System.out.println("method1 start ...");
        method2();
        System.out.println("method1 end ...");
    }

    private static void method2() {
        System.out.println("method2 start ...");
        try {
            method3();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (ArithmeticException e) {
            e.printStackTrace();
        }
        System.out.println("method2 end ...");
    }

    private static void method3() throws FileNotFoundException {
        System.out.println("method3 start ...");
        int x = 10 / 0;
        FileInputStream fin = new FileInputStream("d:/aa.txt");
        System.out.println("method3 end ...");
    }
}
